home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs05.d81
/
evsbasic.arc
/
EVSKEYWORDS.E-F
< prev
next >
Wrap
Text File
|
2009-10-10
|
9KB
|
236 lines
---------------------------------------
ELSE <line#/statements>
The ELSE statement can optionally follow an IF/THEN or IF/GOTO pair on the
same program line. Statements or line numbers following an ELSE behave
exactly as they do when following a THEN or GOTO, but will be executed only
when the IF condition is false. If the condition is true, only statements
or line numbers between THEN and ELSE will be executed.
If an ELSE statement appears on a program line without a preceeding IF/THEN
or IF/GOTO, the ELSE and everything after it on the line will be treated as
a REMark and ignored.
Examples:
10 IF A/2 = INT(A/2) THEN PRINT "EVEN": ELSE PRINT "ODD"
20 IF A>100 THEN 90: ELSE IF A>50 THEN 80: ELSE 70
30 IF A>50 THEN IF A>100 THEN 90: ELSE 80: ELSE 70
---------------------------------------
ENVELOPE <voice# [,<sum>]> [,<att> [,<dec> [,<sus> [,<rel> [,<pnt>]]]]]
The ENVELOPE statement defines an attack/decay/sustain/release (ADSR)
envelope for one or more voices. Together these parameters control how the
volume of a tone produced by a voice changes with time.
EVS Basic numbers the three voices produced by the SID chip as 1, 2, and 3.
Any one of these three voices can be affected by using its number as
<voice#>. In this case <sum> is not used and should not be present. To
affect more than one voice at a time, 0 is used as the <voice#> together
with <sum>. Each voice in the <sum> is given the all parameters that
follow in the statement. <Sum> is calculated by starting with zero and
adding 1 if voice 1 is to be included, 2 for voice 2, and 4 for voice 3.
<Sum> has a maximum value of 7, which would affect all three voices at once
(1+2+4).
The last five parameters of ENVELOPE control the attack rate, decay rate,
sustain level, release rate, and release point. All may range in value
from 0 to 15. The default value for all five parameters for all three
voices is zero, the shortest times and proportions possible.
The attack rate determines how fast volume rises to its maximum level after
a tone begins. The decay rate is how fast the volume then drops to its
sustained volume. The sustain level is the proportion of the maximum
volume that the sustained volume will be. The release rate is how quickly
the volume drops to zero after the tone is released. The release point
determines how long before the end of the tone's duration it is released
and the release portion of the envelope begins to be heard.
Parameters not explicitly set by an ENVELOPE statement retain their current
values.
Examples:
10 ENVELOPE 1, 3, 4, 15, 6, 2
20 ENVELOPE I, AT(I), DC(I), SU(I), RE(I), PN(I)
30 ENVELOPE 0, 7, , , 15
ENVELOPE Time Values (milliseconds)
Value Attack Decay/Release Point
0 2 6 0
1 8 24 17
2 16 48 33
3 24 72 50
4 38 114 67
5 56 168 83
6 68 204 100
7 80 240 117
8 100 300 133
9 250 750 150
10 500 1500 167
11 800 2400 183
12 1000 3000 200
13 3000 9000 217
14 5000 15000 233
15 8000 24000 250
---------------------------------------
ERASE <xpos>, <ypos>
Clears a rectangular block of the screen using the specified <xpos>, <ypos>
as one corner of the block and the current cursor position as the
diagonally opposite corner. After the block is cleared the cursor is
placed at the upper left corner of the block.
ERASE functions in all graphic modes. In text modes <xpos>, <ypos> ranges
from 0, 0 to 39, 24. In bitmap modes the exact range of <xpos>, <ypos>
depends on the current logical screen coordinates. The default range is 0,
0 to 319, 199.
Examples:
10 LOCATE 10, 10: ERASE 20, 20
20 ERASE X+20, Y*5
---------------------------------------
EXIT
The EXIT statement forces an immediate unconditional branch out of the
currently active DO/LOOP. Program execution continues with the statement
following the LOOP statement marking the end of the loop. A conditional
exit may be created by using EXIT as part of an IF/THEN construct.
EXIT provides a way of terminating a DO/LOOP at a point other than the
beginning or end. There is no limit to the number of EXIT statements
allowed within a DO/LOOP.
Examples:
10 EXIT
20 IF A>10 THEN EXIT
30 DO: READ A: IF A<0 THEN EXIT: ELSE PRINT A: LOOP
---------------------------------------
FILTER [<voice# [,<sum>]> ,<enable> [,<cutoff> [,<filtyp> [,<reson>]]]]
The FILTER statement allows control of the filtering capabilities of the
SID chip. The effect of filtering is to diminish or remove selected
frequencies from one or more voices.
The three-part parameter <voice#> [, <sum>], <enable> turns filtering of a
voice on and off. <Voice#> [,<sum>] has the same form and behavior as with
the ENVELOPE statement. <Enable> turns filtering on for <voice#> if it is
non-zero, and off if it is zero. Voices not selected by <voice#> are not
affected. It is recommended that only one voice at a time be filtered.
<Cutoff> may range from 0 to 2047. The actual cutoff frequency ranges from
about 30 Hz to about 12000 Hz according to the formula:
frequency = <cutoff> * 5.8 + 30 Hz
<Filtyp> ranges from 0 to 3, choosing one of four types of filtering. A
<filtyp> of 0 gives a low-pass filter (frequencies above the cutoff
frequency are diminished), 1 a high-pass (frequencies below the cutoff are
diminished), 2 a band-pass (frequencies both above and below the cutoff are
diminished), and 3 a band-reject (frequencies at and close to the cutoff
are diminished).
<Reson> controls filter resonance, which peaks the volume of frequencies
nearest the cutoff. This value may range from 0 (minimum resonance) to 15
(maximum resonance).
Parameters not specified retain their current values. The default values
of <cutoff>, <filtype>, and <reson> are all zero.
Examples:
10 FILTER 1, 1, 1024, 2, 8
20 FILTER 0, 7, 0
30 FOR I=100 TO 1500: FILTER , I , , I/100 : NEXT
---------------------------------------
FMT$(<nexp>, <format$>)
The FMT$() function returns a string representing a formatted number.
<Nexpr> can be any numeric expression. <Format$> can be any string
expression which describes a legal format.
Six different characters may appear in a <format$>: "#", "0", "*", ".",
"+", and "-". The first three are numeric placeholders, the next is the
decimal point, and the last two are "sign" characters. A legal <format$>
is a string of these six characters in any combination and order up to 24
characters long, except that only one of the characters may be a decimal
point.
Numeric placeholder characters reserve places for digit characters in the
returned string. If there are more placeholders than digits, the "0" and
"*" characters remain as they are in the returned string, but the "#"
character is replaced by a space.
The "." character marks where the decimal point should appear. If
<format$> does not include a decimal point, one is considered to be located
one character to the right of the last character in <format$>.
The "+" and "-" sign characters may be placed anywhere in <format$>. The
"-" character explicitly signs only negative values of <nexp>, otherwise
being replaced by a space. "+" explicitly signs all values of <nexp> with
either "-" (if negative) or "+" (if positive).
FMT$() does not round <nexp> to fit <format$>. If <nexpr> is larger than
will fit in <format$>, an "overflow" string of all "*"'s will be returned.
If <nexpr> is too small to fit in <format$>, an "underflow" string of all
"-"'s will be returned. If <format$> is the null string the null string
will be returned.
Examples:
10 PRINT FMT$(123, "####")
20 A$ = FMT$(A, "***0.00")
30 PRINT FMT$(A(I), "+###0.000")
---------------------------------------
FRE(<exp>)
The FRE() function returns the number of bytes of RAM available for program
text and variables. Unlike the V2 Basic version, FRE() always returns a
positive number. If a program tries to use more space than is available,
an "?OUT OF MEMORY" error occurs.
Like the V2 Basic version, executing FRE() triggers a "garbage collection"
to reclaim unused dynamic string variable space. The EVS Basic version of
this process is much faster than the V2 Basic version, resulting in much
shorter "garbage collection" delays.
Examples:
10 A = FRE(0)
20 PRINT "THERE ARE"; FRE(0); "BYTES FREE."